<template>
  <div class="main .clearfix" :class="{ hiddenBlack: closeWindow }">
    <div class="aside fl">
      <el-button type="primary" class="uploadButton" @click="upload">
        <i class="iconfont iconshangchuan">上传</i>
      </el-button>
      <user></user>
      <p class="three">
        获赞 <span>{{ userMessage.praise }}</span> 关注<span>{{
          userMessage.fllow
        }}</span>
        粉丝<span>{{ userMessage.fans }}</span>
      </p>
      <ul class="clearfix">
        <li
          :class="{ action: isaction == 'personalCenter' }"
          @click="jump('personalCenter')"
        >
          <i class="el-icon-user-solid"></i>个人中心
        </li>
        <li :class="{ action: isaction == 'mePhoto' }" @click="jump('mePhoto')">
          <i class="iconfont iconwodexiangce"></i>我的相册
        </li>
        <li
          :class="{ action: isaction == 'allphoto' }"
          @click="jump('allphoto')"
        >
          <i class="iconfont iconwenjianjia1"></i>全部照片
        </li>
        <li :class="{ action: isaction == 'private' }" @click="jump('private')">
          <i class="iconfont iconsimi"></i>私密照片
        </li>
        <li
          :class="{ action: isaction == 'smartSort' }"
          @click="jump('smartSort')"
        >
          <i class="iconfont iconicon"></i>智能分类
        </li>
        <li
          :class="{ action: isaction == 'uploadTab' }"
          @click="jump('uploadTab')"
        >
          <i class="iconfont iconshangchuan"></i>
          上传任务
          <b>
            <img
              class="uploadIcon2"
              src="../assets/pngImg/finsh.png"
              v-show="successNum == uploadNum"
              alt=""
            />
            <img
              class="uploadIcon"
              src="../assets/pngImg/cricle.png"
              v-show="successNum != uploadNum"
              alt=""
            />
            <span class="uploadIconMsg">{{ successNum }}/{{ uploadNum }}</span>
          </b>
        </li>
        <li :class="{ action: isaction == 'recycle' }" @click="jump('recycle')">
          <i class="iconfont iconhuishouzhan"></i>回收站
        </li>
        <li :class="{ action: isaction == 'clip' }" @click="jump('clip')">
          <i class="iconfont iconjianji"></i>精彩时刻
        </li>
      </ul>
    </div>
    <div class="mains fr">
      <div class="head">
        <div class="used">
          <user></user>
        </div>

        <div class="news">
<!--          <news></news>-->
        </div>
      </div>
      <transition name="slide-left">
        <keep-alive>
          <router-view></router-view>
        </keep-alive>
      </transition>
    </div>
<!--    <addto @closeWindows="closeWindows" v-if="closeWindow"></addto>-->
    <shareAblum></shareAblum>
  </div>
</template>

<script>
import shareAblum from "../components/public/ShareAblum.vue";
import news from "@/components/public/News.vue";
import user from "@/components/public/User.vue";
import bus from "@/bus/bus.js";
import addto from "@/components/public/AddTo.vue";
export default {
  data() {
    return {
      uploadNum: 0,
      successNum: 0,
      closeWindow: false,
      isaction: "personalCenter",
      userMessage: {
        userId: "rooter",
        praise: "0",
        fllow: "0",
        fans: "0",
      },
    };
  },
  computed: {
    // isaction(){
    // 	return this.$route.path.split('/')[2]
    // }
  },
  components: {
    addto,
    user,
    news,
    shareAblum,
  },
  created() {
    bus.$on("uploadNum", (num) => {
      this.uploadNum = num;
    });
    bus.$on("successNum", (num) => {
      this.successNum = num;
    });
  },
  mounted() {},
  methods: {
    closeWindows() {
      //关闭上传窗口
      this.closeWindow = false;
    },
    jump(path) {
      this.isaction = path;
      this.$router.push("/home/" + path);
    },
    upload() {
      //上传按钮
      this.closeWindow = true;
      let news = document.querySelector(".news");
      console.log(news);
    },
    changeHead() {},
  },
};
</script>

<style scoped="scoped">
.three span {
  display: inline-block;
  width: 40px;
  margin-top: 20px;
  font-size: 18px;
}
.three {
  text-align: center;
  font-size: 20px;
}
.aside >>> .user {
  width: 100%;
  height: 170px;
  margin-top: 30px;
}
.aside >>> .user i {
  font-size: 30px;
}
.aside >>> .downBottom,
.aside >>> .el-dropdown {
  transform: translate(-40px, 3px);
}
.aside >>> .user .username {
  margin-left: 50%;
  font-size: 25px;
  transform: translateX(-50%);
}
.aside >>> .user .imgs {
  float: none;
  display: block;
  border: #2b3b53 solid 2px;
  height: 100px;
  width: 100px;
  margin: auto;
}
.aside >>> .user .imgs img {
  height: 100px;
  width: 100px;
}
.news {
  position: absolute;
  right: 20px;
  top: 10px;
  width: 60px;
  height: 40px;
}

.Icon-header::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url(../assets/pngImg/header.png) no-repeat;
  background-size: 14px 14px;
  margin-right: 5px;
}
.hiddenBlack::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  z-index: 99;
  opacity: 0.4;
}
@keyframes cricle {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.uploadIconMsg {
  font-size: 12px;
  margin-left: 5px;
  font-weight: 600;
  color: #009a00;
}
.uploadIcon,
.uploadIcon2 {
  width: 30px;
  height: 30px;
  vertical-align: middle;
  margin-left: 10px;
}
.uploadIcon {
  animation: cricle 1s linear infinite;
}
.size {
  min-height: 737px;
  min-width: 1100px;
  margin-top: 60px;
}
.uploadButton {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 100px;
  height: 40px;
}
.aside .iconsimi {
  font-size: 25px;
}
.aside .iconicon {
  font-size: 25px;
}
.aside .iconhuishouzhan {
  font-size: 25px;
}

.el-dropdown-link {
  cursor: pointer;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.demonstration {
  display: block;
  color: #8492a6;
  font-size: 14px;
  margin-bottom: 20px;
}
.used {
  position: absolute;
  right: 100px;
}

.title {
  font-size: 33px;
  position: absolute;
  top: 0;
  right: 0;
  line-height: 90px;
  letter-spacing: 30px;
}
.aside {
  position: relative;
  border-right: 3px #95a8ce solid;
  box-sizing: border-box;
}
.aside ul i {
  margin-right: 10px;
  font-size: 20px;
  margin-left: 80px;
  font-weight: 400;
}
.aside .iconshangchuan {
  margin-right: 7px;
}
.action {
  background-color: #e6e9f4;
  color: #0b2a97;
  border-radius: 20px 0 0 20px;
  border-right: solid 4px #0b2a97;
}
.action::after {
  content: "";
  height: 100%;
  position: absolute;
  border-radius: 4px;
  width: 6px;
  background: #0b2a97;
  top: 0;
  right: 0;
}
.head {
  background: 0 -20px url(../assets/pngImg/headx2.png) no-repeat;
  background-size: auto 150px;
  color: #333;
  width: 100%;
  text-align: center;
  height: 60px;
  position: absolute;
  top: 0;
  z-index: 9;
}
.aside ul {
  margin-top: 20px;
}
.aside ul li {
  transition: 0.5s;
  position: relative;
  float: right;
  width: 305px;
  height: 55px;
  line-height: 55px;
  text-align: left;
  color: #868686;
  cursor: pointer;
  font-size: 20px;
  margin-bottom: 5px;
  font-weight: 400;
}
.aside ul li::after {
  content: "";
  transition: 1s;
}
.aside ul li:hover {
  color: #0b2a97;
}

.aside {
  height: 100%;
  width: 340px;
  background-color: #ffffff;
  overflow: hidden;
}

.mains {
  position: relative;
  background-color: #ffffff;
  color: #333;
  text-align: center;
  height: 100%;
  width: calc(100% - 340px);
  box-sizing: border-box;
  overflow: auto;
}

i::before {
  margin-right: 10px;
}
</style>
